<template>
  <ul class="mui-table-view">
    <li class="mui-table-view-cell mui-media" v-for="items in getnews" :key="items.ptime+Date.now()">
      <router-link to="/home/newslist/news">
        <img class="mui-media-object mui-pull-left" src="https://avatars2.githubusercontent.com/u/798804?s=88&v=4" >
        <div class="mui-media-body">
          <h3>{{ items.digest }}</h3>
          <p class="mui-ellipsis">
            <span>发表时间：{{ items.ptime   }}</span>
            <span>{{ items.category }}</span>
          </p>
        </div>
      </router-link>
    </li>

  </ul>
</template>
<script>
import { Toast } from 'mint-ui';


export default {
  data: function() {
    return {
      getnews: []
    };
  },
  created(){
	  this.getlist();
  },
  methods: {
    getlist() {
		function getData(result){
			if(result.status === 200){
			  var list = result.body.data
			//   console.log(list)

			  for (var key in list){



          
				  for(var i=0;i<list[key].length;i++){
					//   console.log(list[key][i])
				this.getnews.push(list[key][i])
				}

			}


		  }else {
			  Toast('获取信息失败');
		  }
		}
      this.$http.get('journalismApi').then(getData);
	}
  }
  
}

</script>
<style lang="scss" scoped>
.mui-table-view {
  li {
    h3 {
      font-size: 14px;
    }
    .mui-ellipsis {
      font-size: 12px;
      color: #999;
      display: flex;
      justify-content: space-between;
    }
  }
}
</style>